Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use PBKDF2 for the LUKS2 keyslots #286

Merged

Conversation

chrisccoulson
Copy link
Collaborator

We currently use a minimal Argon2i configuration for the main unlock
keyslots and then Argon2i benchmarked to 2s by default for recovery
keyslots. Note that the cryptsetup default now is Argon2id, but Argon2
is overkill in this context anyway.

For the main unlock keyslots, hardcode a minimal PBKDF2 configuration.
Also hardcode a PBKDF2 configuration for the recovery keyslots, but
use 600,000 iterations which is the current OWASP recommendations for
ordinary passphrases
(https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html).
This is still overkill for a 128bit recovery key, and if we implement a
256bit recovery key then we could justify using a minimal configuration
here as well. Note that systemd is using minimal PBKDF2 configurations
for both normal and recovery keyslots.

This simplifies the API by not requiring KDFs to be configured, and
means that the configuration is suitable where FIPS140 compliance is
required.

The test was only implemented in the unmocked suite, but relies on
mocking the call to luks2.Format in order to override the flag. This
may as well just only be a mocked test.
@chrisccoulson chrisccoulson force-pushed the switch-keyslots-to-pbkdf2 branch from 31d7c3c to 1007950 Compare March 11, 2024 23:04
@chrisccoulson chrisccoulson requested a review from pedronis March 11, 2024 23:04
@chrisccoulson chrisccoulson force-pushed the switch-keyslots-to-pbkdf2 branch from 1007950 to 95bfffd Compare March 11, 2024 23:31
We currently use a minimal Argon2i configuration for the main unlock
keyslots and then Argon2i benchmarked to 2s by default for recovery
keyslots. Note that the cryptsetup default now is Argon2id, but Argon2
is overkill in this context anyway.

For the main unlock keyslots, hardcode a minimal PBKDF2 configuration.
Also hardcode a PBKDF2 configuration for the recovery keyslots, but
use 600,000 iterations which is the current OWASP recommendations for
ordinary passphrases
(https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html).
This is still overkill for a 128bit recovery key, and if we implement a
256bit recovery key then we could justify using a minimal configuration
here as well. Note that systemd is using minimal PBKDF2 configurations
for both normal and recovery keyslots.

This simplifies the API by not requiring KDFs to be configured, and
means that the configuration is suitable where FIPS140 compliance is
required.
@chrisccoulson chrisccoulson force-pushed the switch-keyslots-to-pbkdf2 branch from 95bfffd to c2431aa Compare March 12, 2024 00:16
Copy link
Collaborator

@pedronis pedronis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@chrisccoulson chrisccoulson merged commit 3690477 into canonical:master Mar 12, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants